{extend name="Layout/datagrid" /}
{block name="content_header"}        
<h1>
    商城设置
    <small>advanced tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">商城</a></li>
    <li class="active">商城设置</li>
</ol>
{/block}
{block name="content"}
<div class="box">
    <div class="box-header">
        <ul class="nav nav-tabs">
            {foreach name="tabs" item="vo"}
            <li class="{$vo.active}"><a href="{:U($vo['url'])}">{$vo.title}</a></li>
            {/foreach}
        </ul>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
            <div class="col-md-6">
                <!-- form start -->
                <form action="{:U('editSave')}" method="post" class="form-horizontal">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">货币</label>
                            <div class="col-sm-9">
                                <select name="currency" class="form-control input-sm" data-url="{:U('getCurrencyJson')}" data-value="{$data.currency}"></select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">库存</label>
                            <div class="col-sm-9">
                                {xshtml:radio name="stock_enable" data='array("1"=>"启用","0"=>"停用")' value="data['stock_enable']|default='1'" /}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品检索框</label>
                            <div class="col-sm-9">
                                {xshtml:radio name="search_enable" data='array("1"=>"开启","0"=>"关闭")' value="data['search_enable']|default='1'" /}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">确认收货周期</label>
                            <div class="col-sm-9">
                                <div class="input-group">
                                    <input type="number" name="confirm_days" class="form-control input-sm" value="{$data.confirm_days|default=7}" placeholder="确认收货周期" required="required" />
                                    <span class="input-group-addon">天</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">订单过期时间</label>
                            <div class="col-sm-9">
                                <div class="input-group">
                                    <input type="number" name="expire_days" class="form-control input-sm" value="{$data.expire_days|default=30}" placeholder="订单过期时间" required="required" />
                                    <span class="input-group-addon">天</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">新订单发信给</label>
                            <div class="col-sm-9">
                                <input type="text" name="sendto" class="form-control input-sm" placeholder="有新订单时要通知的管理员（多个之间以逗号隔开）" value="{$data.sendto}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">支付方式</label>
                            <div class="col-sm-9">
                                {xshtml:checkbox name="payment[]" data="array('alipay'=>'支付宝即时到帐','wechatpay'=>'微信支付','paypal'=>'贝宝Paypal','blance'=>'余额支付','cod'=>'货到付款')" class="form-control input-sm" value="data.payment" /}
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
                        <button type="submit" class="btn btn-primary pull-right">保存</button>
                    </div>
                    <!-- /.box-footer -->
                    <input type="hidden" name="id" value="{$data.id}"/>
                </form>
            </div>
        </div>
    </div>
    {/block}
    {block name="script_before"}
    <script>
        $('select[name="category_id"]').ajaxcombobox({first: {id: "", text: "选择货币"}});
    </script>
    {/block}